package com.ganzi.ganziitem.netty.conf;

import com.ganzi.ganziitem.netty.NettyServerListener;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MessageEncoder extends MessageToByteEncoder<Object>{
	private static Logger log = LoggerFactory.getLogger(MessageEncoder.class);
	@Override
	protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out)
			throws Exception {
      byte[] data =(byte[]) msg;
      out.writeBytes(data);
      
	}
}
